<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>菜品管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  {include file="public/css"/}
	<style>
		.guigeimg{display: inline-block; position: relative}
		.guigeimg_close{width: 25px;height: 22px;right: -14px;top:-14px;}
	#ggnamediv .layui-input,#ggvaldiv .layui-input{ display:inline;height:30px}
	#ggvaldiv .thumb_img {}
		.layui-form-switch{margin-top: 0}
	</style>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-card layui-col-md12">
				<div class="layui-card-header">
					{if !$info['id']}<i class="fa fa-plus"></i> 添加菜品{else}<i class="fa fa-pencil"></i> 编辑菜品{/if}
					<i class="layui-icon layui-icon-close" style="font-size:18px;font-weight:bold;cursor:pointer" onclick="closeself()"></i>
				</div>
				<div class="layui-card-body" pad15>
					<div class="layui-form form-label-w6">
						<div class="layui-tab" lay-filter="mytab">
							<ul class="layui-tab-title">
								<li class="layui-this" lay-id="1">菜品信息</li>
								<li lay-id="2">菜品详情</li>
							</ul>
							<div class="layui-tab-content">
								<div class="layui-tab-item layui-show">
									<input type="hidden" name="id" value="{$info['id']}"/>
									{if input('param.bid')}<input type="hidden" name="info[bid]" value="{$Request.param.bid}"/>{/if}
									<div class="layui-form-item">
										<label class="layui-form-label"><span class="redstar">*</span>菜品名称：</label>
										<div class="layui-input-inline" style="width:400px">
											<input type="text" name="info[name]" lay-verify="required" lay-verType="tips" class="layui-input" value="{$info['name']}">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">菜品主图：</label>
										<button style="float:left;" type="button" class="layui-btn layui-btn-primary" upload-input="pic" upload-preview="picPreview" onclick="uploader(this)">上传图片</button>
										<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：640×640像素</div>
										<div id="picPreview" class="picsList-class-padding">
											<div class="layui-imgbox imgbox-required">
												<div class="layui-imgbox-img"><img src="{$info['pic']}"/></div>
												<input type="text" name="info[pic]" id="pic" class="layui-input" value="{$info['pic']}">
											</div>
										</div> 
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">菜品图片：</label>
										<input type="hidden" name="info[pics]" value="{$info['pics']}" id="pics">
										<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this,true)" upload-input="pics" upload-preview="picList" >批量上传</button>
										<div class="layui-form-mid layui-word-aux" style="margin-left:10px;">建议尺寸：640×640像素</div>
										<div id="picList" class="picsList-class-padding">
											{if $info['pics']}{php}$pics = explode(',',$info['pics']);{/php}{foreach $pics as $pic}
											<div class="layui-imgbox">
												<a class="layui-imgbox-close" href="javascript:void(0)" onclick="$(this).parent().remove();getpicsval('pics','picList')" title="删除"><i class="layui-icon layui-icon-close-fill-opaque"></i></a>
												<span class="layui-imgbox-img"><img src="{$pic}"></span>
											</div>
											{/foreach}{/if}
										</div>
									</div>
									<!-- <div class="layui-form-item" >
										<label class="layui-form-label">菜品卖点：</label>
										<div class="layui-input-inline" style="width:400px">
											<input type="text" name="info[sellpoint]" class="layui-input" value="{$info['sellpoint']}">
										</div>
										<div class="layui-form-mid layui-word-aux">在菜品详情页标题下面展示卖点信息，建议60字以内</div>
									</div>  -->
									<div class="layui-form-item">
										<label class="layui-form-label">菜品编码：</label>
										<div class="layui-input-inline">
											<input type="text" name="info[procode]" class="layui-input" value="{$info['procode']}">
										</div>
									</div> 
									<div class="layui-form-item">
										<label class="layui-form-label">菜品分类：</label>
										<div class="layui-input-inline" style="width:300px">
											<select name="info[cid]" id="cid" xm-select="selectCid" xm-select-max="5" xm-select-search >
												<option value="">--请选择--</option>
											{foreach $clist as $cv}
												<option value="{$cv['id']}" {if in_array($cv['id'],$info['cid'])}selected{/if}>{$cv['name']}</option>
												{foreach $cv['child'] as $k=>$v}
												{if $k < count($cv['child'])-1}
												<option value="{$v['id']}" {if in_array($v['id'],$info['cid'])}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;├ {$v['name']}</option>
												{else}
												<option value="{$v['id']}" {if in_array($v['id'],$info['cid'])}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;└ {$v['name']}</option>
												{/if}
													{foreach $v['child'] as $k2=>$v2}
													{if $k2 < count($v['child'])-1}
													<option value="{$v2['id']}" {if in_array($v2['id'],$info['cid'])}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├ {$v2['name']}</option>
													{else}
													<option value="{$v2['id']}" {if in_array($v2['id'],$info['cid'])}selected{/if}>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;└ {$v2['name']}</option>
													{/if}
													{/foreach}
												{/foreach}
											{/foreach}
											</select>
										</div>
										<div class="layui-form-mid layui-word-aux">最多可选5个分类</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">菜品描述：</label>
										<div class="layui-input-inline" style="width:400px">
											<input type="text" name="info[sellpoint]"  lay-verType="tips" class="layui-input" value="{$info['sellpoint']}">
										</div>
										<div class="layui-form-mid layui-word-aux">设置为空，前台则不显示</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">出餐区域：</label>
										<div class="layui-input-inline" style="width:300px">
											<select name="info[area_id]" id="area_id">
												<option value="">--请选择--</option>
												{foreach $area_list as $cv}
												<option value="{$cv['id']}" {if $cv['id'] == $info['area_id']}selected{/if}>{$cv['name']}</option>
												{/foreach}
											</select>
										</div>
										<div class="layui-form-mid layui-word-aux">绑定出餐区域，用户下单后可分区域打印小票</div>
									</div>
									{if $typelist}
									<div class="layui-form-item">
										<label class="layui-form-label">菜品类型：</label>
										<div class="layui-input-inline" style="width: 320px">
											{volist name="typelist" id="item"}
											<input type="radio" name="info[product_type]" value="{$item.type}" {if (!$info['id'] && $item['type']==0) || $info['product_type']==$item['type']}checked{/if} title="{$item.name}" lay-filter="product_type">
											{/volist}
										</div>
										<div class="layui-form-mid layui-word-aux">
											{if getcustom('restaurant_weigh')}	<span id="weight_type_tip" {if $info['product_type']!=1}style="display:none"{/if}>使用称重菜品时，请在设置中开启餐后付款；销售价为每斤的价格，不进行库存校验</span>{/if}
											{if getcustom('restaurant_product_package')}	<span id="package_type_tip" {if $info['product_type']!=2}style="display:none"{/if}>使用套餐产品，规格将失效，下单使用套餐内的商品进行下单</span>{/if}
										</div>
									</div>
									{/if}
									{if getcustom('restaurant_product_package')}
									<!--套餐最外层div-->
									<div id="package_div" {if $info['product_type']!=2}style="display:none"{/if}>
										<div class="layui-form-item">
											<label class="layui-form-label">参与会员折扣：</label>
											<div class="layui-input-inline" style="width: 220px">
												<input type="radio" name="info[package_is_discount]" value="1" {if $info['package_is_discount']==1}checked{/if} title="开启"   >
												<input type="radio" name="info[package_is_discount]" value="0" {if !$info['id'] || $info['package_is_discount']==0}checked{/if} title="关闭" >
											</div>
											<div class="layui-form-mid layui-word-aux">当前套餐是否参与会员折扣</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">可用优惠券：</label>
											<div class="layui-input-inline" style="width: 220px">
												<input type="radio" name="info[package_is_coupon]" value="1" {if $info['package_is_coupon']==1}checked{/if} title="开启"   >
												<input type="radio" name="info[package_is_coupon]" value="0" {if !$info['id'] || $info['package_is_coupon']==0}checked{/if} title="关闭" >
											</div>
											<div class="layui-form-mid layui-word-aux">当前套餐是否可用优惠券</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">参与促销：</label>
											<div class="layui-input-inline" style="width: 220px">
												<input type="radio" name="info[package_is_cuxiao]" value="1" {if $info['package_is_cuxiao']==1}checked{/if} title="开启"   >
												<input type="radio" name="info[package_is_cuxiao]" value="0" {if !$info['id'] || $info['package_is_cuxiao']==0}checked{/if} title="关闭" >
											</div>
											<div class="layui-form-mid layui-word-aux">当前套餐是否参与促销</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">套餐价格：</label>
											<div class="layui-input-inline">
												<input type="text" name="info[package_price]" class="layui-input" value="{$info['package_price']}">
											</div>
										</div>
									<!--套餐添加按钮-->
										<div class="layui-form-item" >
											<label class="layui-form-label">套餐列表：</label>
											
											<button style="float:left;" type="button" class="layui-btn " onclick="addpackagelist()"  >添加套餐</button>
										</div>
										<!--套餐内容-->
										<div id="packpagelist">
											{php} $packagelist = json_decode($info['packagedata'],true);{/php}
											{if $packagelist}
											{foreach $packagelist as $k=>$package}
											<div class="layui-form-item packagelist" style="margin-left:125px ">

												<div class="layui-form-item">
													<label class="layui-form-label" style="width: 75px;padding-left: 0">分类名称：</label>
													<input type="text" name="category_name[]" lay-vertype="tips" class="layui-input" value="{$package['category_name']}" style="width: 200px;display: inline-block">
												</div>
												
												<div class="layui-form-item" >
													<label class="layui-form-label" style="width: 75px;padding-left: 0">套餐类型：</label>
												    
													<input type="radio" name="package_type[{$k}]" value="0" {if $package['type'] ==0}checked="true"{/if} title="固定" lay-filter="package_type" >
													<input type="radio" name="package_type[{$k}]" value="1" {if $package['type'] ==1}checked="true"{/if} title="单选" lay-filter="package_type">
													<input type="radio" name="package_type[{$k}]" value="2" {if $package['type'] ==2}checked="true"{/if} title="多选" lay-filter="package_type">
												</div>
												<div class="layui-form-item select_num" {if $package['type'] !=2}style="display: none"{/if} >
													<label class="layui-form-label" style="width: 75px;padding-left: 0">选择数量：</label>
													<div class="layui-input-inline" style="width:300px">
														<input type="number"  name="selectnum[]" min="0" value="{$package['selectnum']}"lay-vertype="tips" autocomplete="off" class="layui-input">
													</div>
												</div>
												<label class="layui-form-label" style="width: 75px;padding-left: 0">已选菜品：</label>
												<table   class="layui-table" style="width:650px">
														<thead>
														<tr>
															<th>菜品ID</th>
															<th>菜品名称</th>
															<th>规格名称</th>
															<th>价格</th>
															<th>份数</th>
															<th>加价</th>
															<th>操作</th>
														</tr>
														</thead>
													<tbody class="product_table{$k}">
														{if $package['prolist']}
														
														{foreach $package['prolist'] as $pk=>$pro}
														<tr class="productlisttr">
															<td><input type="hidden" name="product[proid][{$k}][]" value="{$pro.proid}"/>{$pro.proid}</td>
															<td><input type="hidden" name="product[proname][{$k}][]" value="{$pro.proname}"/>{$pro.proname}</td>
															<td><input type="hidden" name="product[ggid][{$k}][]" value="{$pro.ggid}"/><input type="hidden" name="product[guigename][{$k}][]" value="{$pro.ggname}"/>{$pro.ggname}</td>
															<td><input type="hidden" name="product[sell_price][{$k}][]"  value="{$pro.sell_price}" >{$pro.sell_price}</td>
															
															<td><input type="number" class="layui-input" name="product[num][{$k}][]"  value="{$pro.num}" style="width: 80px" min="1" ></td>
															
															<td><input type="number" class="layui-input" name="product[add_price][{$k}][]"  value="{$pro.add_price}" style="width: 80px"></td>
															
															<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td></tr>
														{/foreach}
														{/if}
														</tbody>
														<td colspan="7" style="text-align:center;">
															<button type="button" class="layui-btn layui-btn-normal" onclick="showChooseProduct3({$k},1)">添加定制菜品</button>
															<button type="button" class="layui-btn" onclick="showChooseProduct3({$k})">添加普通菜品</button>
														</td>
													</table>
												<button type="button" class="layui-btn layui-btn-warm" onclick="$(this).parent().html('')" style="margin-left: 90px">移除</button>
											</div>
											{/foreach}
											{/if}
											<!--添加的时候 append-->
										
										</div>
										<!--套餐内容-->
									</div>
									<!--套餐最外层div-->
									{/if}
									
									<div class="layui-form-item" id="setgg" {if $info['product_type'] ==2}style="display:none"{/if}>
										<label class="layui-form-label">设置规格：</label>
										<div class="layui-input-inline" style="width:auto;">
											<table id="ggnamediv"  class="layui-table" style="width:600px">
												<thead>
												<tr>
													<th>规格分组</th>
													<th>规格名称</th>
													<th>操作</th>
												</tr>
												</thead>
												{php} $guigedata = json_decode($info['guigedata']);{/php}
												{if $guigedata}
												{foreach $guigedata as $k=>$gg}
												<tr>
													<td><input type="text" class="layui-input" name="ggname" value="{$gg->title}" style="width:120px"/></td>
													<td>
														{foreach $gg->items as $k2=>$ggitem}
														<div><input type="text" class="layui-input"style="width:180px" value="{$ggitem->title}" placeholder="请输入规格名称">
															{if $k2==0}
															<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addggname(this)" style="margin-top:-3px;"><i class="fa fa-plus" style="font-size:14px!important"></i></button>
															{else}
															<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().remove()" style="margin-top:-3px;"><i class="fa fa-remove" style="font-size:14px!important"></i></button>
															{/if}
														</div>
														{/foreach}
													</td>
													{if $k==0}
													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addggtype()">添加</button></td>
													{else}
													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td>
													{/if}
												</tr>
												{/foreach}
												{else}
												<tr>
													<td><input type="text" class="layui-input" name="ggname" value="规格" style="width:120px"/></td>
													<td><div><input type="text" class="layui-input" style="width:180px" value="默认规格" placeholder="请输入规格名称"> <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addggname(this)" style="margin-top:-3px;"><i class="fa fa-plus" style="font-size:14px!important"></i></button></div></td>
													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addggtype()">添加</button></td>
												</tr>
												{/if}
											</table>
											<div class="layui-word-aux">提示：先点击“添加按钮”添加规格分组，如：“口味”，“餐量”，若只有一种规格则不需要添加规格分组；<br/>然后分别点击"＋"号添加规格名称，如：“微辣”，“中辣”；“大份”，“小份”；<br/>设置完成后点击“刷新规格项目表”按钮进行编辑各个规格的价格、库存等信息</div>
											<button type="button"  class="layui-btn layui-btn-sm layui-btn-primary" onclick="refreshgg()"><i class="fa fa-refresh" style="font-size:14px!important"></i>刷新规格项目表</button>
											
											<button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="lvpriceset()" id="lvpricebtn">{if $info['lvprice']==1}关闭{else}开启{/if}会员价</button>
											<input type="hidden" name="info[lvprice]" value="{$info['id']?$info['lvprice']:'0'}"/>
											
											<table id="ggvaldiv" class="layui-table" style="margin-top:20px;">
											</table>
											
<!--											<table id="ggvaldiv" class="layui-table" style="margin-top:20px;">-->
<!--												<thead>-->
<!--													<tr>-->
<!--														<th>规格</th>-->
<!--														<th>市场价（元）</th>-->
<!--														<th>成本价（元）</th>-->
<!--														{if $info['lvprice']==1}-->
<!--														{foreach $levellist as $level}-->
<!--														<th class="level-price">{$level.name}（元）</th>-->
<!--														{/foreach}-->
<!--														{else}-->
<!--														<th class="sell-price">销售价（元）</th>-->
<!--														{/if}-->
<!--														<th>每日库存</th>-->
<!--														<th>总库存</th>-->
<!--														{if $bid==0}<th>赠{:t('积分')}(个)</th>{/if}-->
<!--														<th>图片</th>-->
<!--														<th>操作</th>-->
<!--													</tr>-->
<!--												</thead>-->
<!--												{php} $i=0;$ksLast = 0;{/php}-->
<!--												{if $guige_list}-->
<!--												{foreach $guige_list as $ks => $gg}-->
<!--												<tr data-ks="{$ks}">-->
<!--													<td>-->
<!--														<input name="option[{$ks}][name]" type="text" value="{$gg['name']}" class="layui-input"/>-->
<!--													</td>-->
<!--													<td>-->
<!--														<input name="option[{$ks}][market_price]" type="text" class="layui-input" style="width:70px" value="{if $gg['market_price']!=null}{$gg['market_price']}{/if}"/>-->
<!--														{if $i == 0}-->
<!--														 <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('market_price')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													<td>-->
<!--														<input name="option[{$ks}][cost_price]" type="text" class="layui-input" style="width:70px" value="{if $gg['cost_price']!=null}{$gg['cost_price']}{/if}"/>-->
<!--														{if $i == 0}-->
<!--														 <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('cost_price')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{if $info['lvprice']==1}-->
<!--														{foreach $levellist as $lk=>$level}-->
<!--														<td class="level-price">-->
<!--															<input name="option[{$ks}][sell_price_{$level.id}]" type="text"-->
<!--																   style="width:70px" value="{if $gg['lvprice_data']==null || $gg['lvprice_data'][$level['id']]!=null}{$gg['lvprice_data'][$level['id']]}{/if}" class="layui-input" id="levelprice_{$i}_{$lk}"/>-->
<!--															{if $i == 0}-->
<!--															{if $lk==0}-->
<!--															<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('sell_price_{$level.id}')"></i>-->
<!--															{else}-->
<!--															<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plsetlevelprice({$i},'{$lk}')"></i>-->
<!--															{/if}-->
<!--															{/if}-->
<!--														</td>-->
<!--													{/foreach}-->

<!--													{else}-->
<!--													<td class="sell-price">-->
<!--														<input name="option[{$ks}][sell_price]" type="text" style="width:70px" value="{if $gg['sell_price']!=null}{$gg['sell_price']}{/if}" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														 <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('sell_price')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{/if}-->
<!--													<td>-->
<!--														<input name="option[{$ks}][stock_daily]" type="text" style="width:60px" value="{if $gg['stock_daily']!=null}{$gg['stock_daily']}{/if}" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--													 	<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('stock_daily')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													<td>-->
<!--														<input name="option[{$ks}][stock]" type="text" style="width:60px" value="{if $gg['stock']!=null}{$gg['stock']}{/if}" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('stock')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{if $bid==0}-->
<!--													<td>-->
<!--														<input name="option[{$ks}][givescore]" type="text" style="width:60px" value="{if $gg['givescore']!=null}{$gg['givescore']}{/if}" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('givescore')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{/if}-->
<!--													<td id="ggpic{$ks}">-->
<!--														<input type="hidden" name="option[{$ks}][pic]" id="ggpicval{$ks}" value="{if $gg['pic']!=null}{$gg['pic']}{/if}"/><img class="thumb_img" src="{if $gg['pic']!=null}{$gg['pic']}{/if}" style="max-width:50px;"/><button class="layui-btn layui-btn-sm layui-btn-primary" onclick="uploader(this)" upload-input="ggpicval{$ks}" upload-preview="ggpic{$ks}" type="button">上传</button>-->
<!--													</td>-->
<!--													{if $i == 0}-->
<!--													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addGuige()">添加</button></td>-->
<!--													{else}-->
<!--													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="delGuige(this)">删除</button></td>-->
<!--													{/if}-->
<!--												</tr>-->
<!--												{php} $i++; if($i == count($guige_list)) $ksLast = $ks;{/php}-->
<!--												{/foreach}-->
<!--												{else}-->
<!--												<tr data-ks="0">-->
<!--													<td>-->
<!--														<input name="option[0][name]" type="text" value="默认规格" class="layui-input"/>-->
<!--													</td>-->
<!--													<td>-->
<!--														<input name="option[0][market_price]" type="text" class="layui-input" style="width:70px" value=""/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('market_price')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													<td>-->
<!--														<input name="option[0][cost_price]" type="text" class="layui-input" style="width:70px" value=""/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('cost_price')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{if $info['lvprice']==1}-->
<!--													{foreach $levellist as $lk=>$level}-->
<!--													<td class="level-price">-->
<!--														<input name="option[0][sell_price_{$level.id}]" type="text" style="width:70px" value="" class="layui-input" id="levelprice_0_{$lk}"/>-->
<!--														{if $i == 0}-->
<!--														{if $lk==0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('sell_price_{$level.id}')"></i>-->
<!--														{else}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plsetlevelprice({$i},'{$lk}')"></i>-->
<!--														{/if}-->
<!--														{/if}-->
<!--													</td>-->
<!--													{/foreach}-->

<!--													{else}-->
<!--													<td class="sell-price">-->
<!--														<input name="option[0][sell_price]" type="text" style="width:70px" value="" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('sell_price')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{/if}-->
<!--													<td>-->
<!--														<input name="option[0][stock_daily]" type="text" style="width:60px" value="1000" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('stock_daily')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													<td>-->
<!--														<input name="option[0][stock]" type="text" style="width:60px" value="1000" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('stock')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{if $bid==0}-->
<!--													<td>-->
<!--														<input name="option[0][givescore]" type="text" style="width:60px" value="0" class="layui-input"/>-->
<!--														{if $i == 0}-->
<!--														<i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset('givescore')"></i>-->
<!--														{/if}-->
<!--													</td>-->
<!--													{/if}-->
<!--													<td id="ggpic">-->
<!--														<input type="hidden" name="option[0][pic]" id="ggpicval" value=""/>-->
<!--														<img class="thumb_img" src="" style="max-width:50px;"/>-->
<!--														<button class="layui-btn layui-btn-sm layui-btn-primary" onclick="uploader(this)" upload-input="ggpicval" upload-preview="ggpic" type="button">上传</button>-->
<!--													</td>-->
<!--													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addGuige()">添加</button></td>-->
<!--												</tr>-->
<!--												{/if}-->
<!--											</table>-->
<!--										-->
											<div class="layui-form-mid layui-word-aux">注：开启会员价可设置不同会员等级显示不同价格；赠{:t('积分')}确认收货才赠送，与系统设置中的消费赠送{:t('积分')}(支付就赠送{:t('积分')})兼得</div>
											<input type="hidden" name="specs" value=""/>
										</div>
									</div>
									{if getcustom('restaurant_product_jialiao')}
									<div id="product_jialiao" {if $info['product_type'] ==2}style="display:none"{/if}>
										<div class="layui-form-item">
											<label class="layui-form-label">加料：</label>
											<div class="layui-input-inline" style="width:300px">
												<table  class="layui-table" style="width:600px">
													<thead>
													<tr>
														<th>名称</th>
														<th>价格</th>
														<th>限购</th>
														<th>操作</th>
													</tr>
													</thead>
													<tbody id="jldiv">
													{if $jialiao}
													{foreach $jialiao as $k=>$jl}
													<tr>
														<input type="hidden"  class="layui-input"  value="{$jl['id']}" name="jl[id][]" />
														<td ><input type="text" placeholder="请输入加料名称" class="layui-input" name="jl[title][]" value="{$jl['title']}"  /></td>
														<td ><input type="number" class="layui-input" value="{$jl['price']}"   min="0" placeholder="请输入价格" lay-verify="" name="jl[price][]"></td>
														<td ><input type="number" name="jl[limit_num][]" class="layui-input"  value="{$jl['limit_num']}" placeholder="请输入限购数量" lay-verify="" min="1"></td>
														<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td>
													</tr>
													{/foreach}
													{/if}
													</tbody>
													<tr><td colspan="4" style="text-align:center;"><button type="button" class="layui-btn  " onclick="addjl()">添加</button></td></tr>
												</table>
											</div>
										</div>
										<script>
											function addjl(){
												var gghtml = '<tr>';
												gghtml += '<input type="hidden"  class="layui-input"  value="" name="jl[id][]" /><td ><input type="text" class="layui-input" name="jl[title][]" value="" placeholder="请输入加料名称" lay-verify="" /></td>';
												gghtml += '<td ><input type="number" class="layui-input" name="jl[price][]" value="0.00" placeholder="请输入价格" lay-verify="" min="0"></td>';
												gghtml += '<td ><input type="number" class="layui-input" name="jl[limit_num][]" value="1" placeholder="请输入限购数量" lay-verify="" min="1"></td>';
												gghtml += '<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td>';
												gghtml += '</tr>';
												$('#jldiv').append(gghtml);
											}
										</script>
										<div class="layui-form-item">
											<label class="layui-form-label">加料总数：</label>
											<div class="layui-input-inline" style="width:220px">
												<input type="text" name="info[jl_total_limit]"  lay-verType="tips" class="layui-input" value="{$info['jl_total_limit']}">
											</div>
											<div class="layui-form-mid layui-word-aux">加料选择总数</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">是否必选：</label>
											<div class="layui-input-inline" style="width: 220px">
												<input type="radio" name="info[jl_is_selected]" value="1" {if $info['jl_is_selected']==1}checked{/if} title="必选"   >
												<input type="radio" name="info[jl_is_selected]" value="0" {if !$info['id'] || $info['jl_is_selected']==0}checked{/if} title="非必选" >
											</div>
											<div class="layui-form-mid layui-word-aux">加料是否必选</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">是否打折：</label>
											<div class="layui-input-inline" style="width: 220px">
												<input type="radio" name="info[jl_is_discount]" value="1" {if $info['jl_is_discount']==1}checked{/if} title="打折"   >
												<input type="radio" name="info[jl_is_discount]" value="0" {if !$info['id'] || $info['jl_is_discount']==0}checked{/if} title="不打折" >
											</div>
											<div class="layui-form-mid layui-word-aux">加料是否参与{:t('会员')}折扣</div>
										</div>
										<div class="layui-form-item">
											<label class="layui-form-label">是否参与促销：</label>
											<div class="layui-input-inline" style="width: 220px">
												<input type="radio" name="info[jl_is_cuxiao]" value="1" {if $info['jl_is_cuxiao']==1}checked{/if} title="参与"   >
												<input type="radio" name="info[jl_is_cuxiao]" value="0" {if !$info['id'] || $info['jl_is_cuxiao']==0}checked{/if} title="不参与" >
											</div>
											<div class="layui-form-mid layui-word-aux">加料参与促销活动</div>
										</div>
									</div>
									{/if}
									{if getcustom('product_jialiao')}
									<div class="layui-form-item">
										<label class="layui-form-label">售卖加料：</label>
										<div class="layui-input-inline" style="width:300px">
											<table id="jlnamediv"  class="layui-table" style="width:600px">
												<thead>
												<tr>
													<th>加料名称</th>
													<th>价格</th>
													<th>操作</th>
												</tr>
												</thead>
												{php} $jialiaodata = json_decode($info['jialiaodata']);{/php}
												{if $jialiaodata}
													{foreach $jialiaodata as $k=>$gg}
													<tr>
														<td ><input type="text" placeholder="请输入加料名称" class="layui-input" name="jltitle" value="{$gg->jltitle}"  /></td>
														<td ><input type="number" class="layui-input" value="{$gg->price}"   min="0" placeholder="请输入价格" lay-verify="" name="price"></td>
														{if $k==0}
														<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addjialiao()">添加</button></td>
														{else}
														<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td>
														{/if}
													</tr>
													{/foreach}
												{else}
												<tr>
													<td ><input type="text" class="layui-input" name="jltitle" value="" placeholder="请输入加料名称"  /></td>
													<td ><input type="number" name="price" class="layui-input"  value="0.00" placeholder="请输入价格" lay-verify="" min="0"></td>
													<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addjialiao()">添加</button></td>
												</tr>
												{/if}
											</table>
										</div>
									</div>
									{/if}
									
									{if $bid==0 || $bset['commission_canset']==1}
									<div class="layui-form-item">
										<label class="layui-form-label">分销设置：</label>
										<div class="layui-input-block" style="width:750px">
											<input type="radio" name="info[commissionset]" value="0" {if !$info['id'] || $info['commissionset']==0}checked{/if} title="按照{:t('会员')}等级" lay-filter="commissionset">
											<input type="radio" name="info[commissionset]" value="1" {if $info['commissionset']==1}checked{/if} title="单独设置提成比例" lay-filter="commissionset">
											<input type="radio" name="info[commissionset]" value="2" {if $info['commissionset']==2}checked{/if} title="单独设置提成金额" lay-filter="commissionset">
											<input type="radio" name="info[commissionset]" value="3" {if $info['commissionset']==3}checked{/if} title="分销送{:t('积分')}" lay-filter="commissionset">
											<input type="radio" name="info[commissionset]" value="-1" {if $info['commissionset']==-1}checked{/if} title="不参与分销" lay-filter="commissionset">
										</div>
										<div class="layui-form-mid layui-word-aux">按照{:t('会员')}等级：按照{:t('会员')}等级中设置的提成比例进行提成分配，提成=对应{:t('会员')}等级的提成比例×{$jiesuantypeDesc}×购买数量<br>
										单独设置提成比例：按照单独设置的提成比例进行提成分配，提成=设置的百分比×{$jiesuantypeDesc}×购买数量<br>
										单独设置提成金额：按照单独设置的提成金额进行提成分配，提成=提成金额×购买数量<br>
										分销送{:t('积分')}：分销提成不给{:t('佣金')}而是给{:t('积分')}，得到的积分=提成{:t('积分')}×购买数量
										</div>
									</div>
									{php}
									$commissiondata1 = json_decode($info['commissiondata1'],true);
									if(!$commissiondata1) $commissiondata1 = [];
									$commissiondata2 = json_decode($info['commissiondata2'],true);
									if(!$commissiondata2) $commissiondata2 = [];
									$commissiondata3 = json_decode($info['commissiondata3'],true);
									if(!$commissiondata3) $commissiondata3 = [];
									{/php}
									<div id="commissionset1" {if $info['commissionset']!=1}style="display:none"{/if}>
										{if !$aglevellist}
										<div class="layui-form-item">
											<label class="layui-form-label">提成比例：</label>
											<div class="layui-form-mid" style="color:red">未设置具有分销权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置分销权限</div>
										</div>
										{else}
										{foreach $aglevellist as $level}
										<div class="layui-form-item">
											<label class="layui-form-label">{$level.name}：</label>
											<div class="layui-input-inline layui-module-itemL">
												<div> 一级(%) </div>
												<input type="text" name="commissiondata1[{$level.id}][commission1]" class="layui-input" value="{$commissiondata1[$level['id']]['commission1']}">
											</div>
											{if $level['can_agent']>1}
											<div class="layui-input-inline layui-module-itemL">
												<div>二级(%)</div>
												<input type="text" name="commissiondata1[{$level.id}][commission2]" class="layui-input" value="{$commissiondata1[$level['id']]['commission2']}">
											</div>
											{/if}
											{if $level['can_agent']>2}
											<div class="layui-input-inline layui-module-itemL">
												<div>三级(%)</div>
												<input type="text" name="commissiondata1[{$level.id}][commission3]" class="layui-input" value="{$commissiondata1[$level['id']]['commission3']}">
											</div>
											{/if}
										</div>
										{/foreach}
										{/if}
									</div>
									<div id="commissionset2" {if $info['commissionset']!=2}style="display:none"{/if}>
										{if !$aglevellist}
										<div class="layui-form-item">
											<label class="layui-form-label">提成金额：</label>
											<div class="layui-form-mid" style="color:red">未设置具有分销权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置分销权限</div>
										</div>
										{else}
										{foreach $aglevellist as $level}
										<div class="layui-form-item">
											<label class="layui-form-label">{$level.name}：</label>
											<div class="layui-input-inline layui-module-itemL">
												<div> 一级(元) </div>
												<input type="text" name="commissiondata2[{$level.id}][commission1]" class="layui-input" value="{$commissiondata2[$level['id']]['commission1']}">
											</div>
											{if $level['can_agent']>1}
											<div class="layui-input-inline layui-module-itemL">
												<div>二级(元)</div>
												<input type="text" name="commissiondata2[{$level.id}][commission2]" class="layui-input" value="{$commissiondata2[$level['id']]['commission2']}">
											</div>
											{/if}
											{if $level['can_agent']>2}
											<div class="layui-input-inline layui-module-itemL">
												<div>三级(元)</div>
												<input type="text" name="commissiondata2[{$level.id}][commission3]" class="layui-input" value="{$commissiondata2[$level['id']]['commission3']}">
											</div>
											{/if}
										</div>
										{/foreach}
										{/if}
									</div>
									<div id="commissionset3" {if $info['commissionset']!=3}style="display:none"{/if}>
										{if !$aglevellist}
										<div class="layui-form-item">
											<label class="layui-form-label">提成{:t('积分')}：</label>
											<div class="layui-form-mid" style="color:red">未设置具有分销权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置分销权限</div>
										</div>
										{else}
										{foreach $aglevellist as $level}
										<div class="layui-form-item">
											<label class="layui-form-label">{$level.name}：</label>
											<div class="layui-input-inline layui-module-itemL">
												<div> 一级({:t('积分')}) </div>
												<input type="text" name="commissiondata3[{$level.id}][commission1]" class="layui-input" value="{$commissiondata3[$level['id']]['commission1']}">
											</div>
											{if $level['can_agent']>1}
											<div class="layui-input-inline layui-module-itemL">
												<div>二级({:t('积分')})</div>
												<input type="text" name="commissiondata3[{$level.id}][commission2]" class="layui-input" value="{$commissiondata3[$level['id']]['commission2']}">
											</div>
											{/if}
											{if $level['can_agent']>2}
											<div class="layui-input-inline layui-module-itemL">
												<div>三级({:t('积分')})</div>
												<input type="text" name="commissiondata3[{$level.id}][commission3]" class="layui-input" value="{$commissiondata3[$level['id']]['commission3']}">
											</div>
											{/if}
										</div>
										{/foreach}
										{/if}
									</div>
									{/if}
									{if $bid==0 || $business_selfscore == 1 || $bcansetscore}
									<div class="layui-form-item">
										<label class="layui-form-label">{:t('积分')}抵扣：</label>
										<div class="layui-input-block" style="width:800px">
											<input type="radio" name="info[scored_set]" value="0" {if !$info['id'] || $info['scored_set']==0}checked{/if} title="按照系统设置抵扣" lay-filter="scored_set">
											<input type="radio" name="info[scored_set]" value="1" {if $info['scored_set']==1}checked{/if} title="单独设置抵扣比例" lay-filter="scored_set">
											<input type="radio" name="info[scored_set]" value="2" {if $info['scored_set']==2}checked{/if} title="单独设置抵扣金额" lay-filter="scored_set">
											<input type="radio" name="info[scored_set]" value="-1" {if $info['scored_set']==-1}checked{/if} title="不可用{:t('积分')}抵扣" lay-filter="scored_set">
										</div>
									</div>
									<div id="scored_set1" {if $info['scored_set']!=1 && $info['scored_set']!=2}style="display:none"{/if}>
										<div class="layui-form-item">
											<label class="layui-form-label"></label>
											<div class="layui-input-inline layui-module-itemL">
												<div>最多抵扣(<span id="scoredkmaxunit">{$info['scored_set']==1?'%':'元'}</span>) </div>
												<input style="width: 190px;" type="text" name="info[scored_val]" value="{$info.scored_val}" class="layui-input">
											</div>
										</div>
									</div>
									{/if}
								<!--分红设置-->
								{if getcustom('restaurant_fenhong') && getcustom('restaurant_fenhong_product_set') &&  $bid==0 && ($auth_data=='all' || in_array('gdfenhong',$auth_data) || in_array('teamfenhong',$auth_data) || in_array('areafenhong',$auth_data))}
								<div class="layui-form-item">
								  <label class="layui-form-label">分红设置：</label>
								  <div class="layui-input-block" style="width:800px">
									  <input type="radio" name="info[fenhongset]" value="1" {if !$info['id'] || $info['fenhongset']==1}checked{/if} title="参与" lay-filter="fenhongset">
									  <input type="radio" name="info[fenhongset]" value="0" {if $info['id'] && $info['fenhongset']==0}checked{/if} title="不参与" lay-filter="fenhongset">
								  </div>
								</div>
								<div id="fenhongset" {if $info['id'] && $info['fenhongset']==0}style="display:none"{/if}>
								  
								<!--团队分红-->
								{if $auth_data=='all' || in_array('teamfenhong',$auth_data)}
								  <div class="layui-form-item">
									  <label class="layui-form-label">团队分红：</label>
									  <div class="layui-input-block" style="width:850px">
										  <input type="radio" name="info[teamfenhongset]" value="0" {if !$info['id'] || $info['teamfenhongset']==0}checked{/if} title="按照{:t('会员')}等级" lay-filter="diandaSwitchMulti">
										  <input type="radio" name="info[teamfenhongset]" value="1" {if $info['teamfenhongset']==1}checked{/if} title="单独设置分红比例" lay-filter="diandaSwitchMulti">
										  <input type="radio" name="info[teamfenhongset]" value="2" {if $info['teamfenhongset']==2}checked{/if} title="单独设置分红金额" lay-filter="diandaSwitchMulti">
										  <input type="radio" name="info[teamfenhongset]" value="-1" {if $info['teamfenhongset']==-1}checked{/if} title="不参与分红" lay-filter="diandaSwitchMulti">
									  </div>
									  <div class="layui-form-mid layui-word-aux">开启后可以拿到团队中所有{:t('会员')}的所有商城订单的分红金额或比例，请先在[{:t('会员')}]-[等级及分销]设置分红级数</div>
								  </div>
								  {php}
								  $teamfenhongdata1 = json_decode($info['teamfenhongdata1'],true);
								  if(!$teamfenhongdata1) $teamfenhongdata1 = [];
								  $teamfenhongdata2 = json_decode($info['teamfenhongdata2'],true);
								  if(!$teamfenhongdata2) $teamfenhongdata2  = [];
								  {/php}
								  <div diandaSwitchMulti="info[teamfenhongset]" data-val="1" {if $info['teamfenhongset']!=1}style="display:none"{/if}>
								  <div class="layui-form-item">
									  <label class="layui-form-label">分红比例：</label>
									  {if !$teamlevellist}<div class="layui-form-mid" style="color:red">未设置具有团队分红权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置</div>{/if}
									  {foreach $teamlevellist as $level}
									  <div class="layui-input-inline layui-module-itemL">
										  <div> {$level.name}(%) </div>
										  <input type="text" name="teamfenhongdata1[{$level.id}][commission]" class="layui-input" value="{$teamfenhongdata1[$level['id']]['commission']}">
									  </div>
									  {/foreach}
								  </div>
								  </div>
								  <div diandaSwitchMulti="info[teamfenhongset]" data-val="2" {if $info['teamfenhongset']!=2}style="display:none"{/if}>
								  <div class="layui-form-item">
									  <label class="layui-form-label">分红金额：</label>
									  {if !$teamlevellist}<div class="layui-form-mid" style="color:red">未设置具有团队分红权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置</div>{/if}
									  {foreach $teamlevellist as $level}
									  <div class="layui-input-inline layui-module-itemL mt5">
										  <div> {$level.name}(元) </div>
										  <input type="text" name="teamfenhongdata2[{$level.id}][commission]" class="layui-input" value="{$teamfenhongdata2[$level['id']]['commission']}">
									  </div>
									  {/foreach}
								  </div>
								  </div>
								{/if}  
								<!--团队分红end-->
								<!--股东分红-->
								{if $auth_data=='all' || in_array('gdfenhong',$auth_data)}
								<div class="layui-form-item">
								  <label class="layui-form-label">股东分红：</label>
								  <div class="layui-input-block" style="width:980px">
									  <input type="radio" name="info[gdfenhongset]" value="0" {if !$info['id'] || $info['gdfenhongset']==0}checked{/if} title="按照会员等级" lay-filter="diandaSwitchMulti">
									  <input type="radio" name="info[gdfenhongset]" value="1" {if $info['gdfenhongset']==1}checked{/if} title="单独设置分红比例" lay-filter="diandaSwitchMulti">
									  <input type="radio" name="info[gdfenhongset]" value="2" {if $info['gdfenhongset']==2}checked{/if} title="单独设置分红金额" lay-filter="diandaSwitchMulti">
									  <input type="radio" name="info[gdfenhongset]" value="-1" {if $info['gdfenhongset']==-1}checked{/if} title="不参与分红" lay-filter="diandaSwitchMulti">
								  </div>
								  <div class="layui-form-mid layui-word-aux">用于股东分红或合伙人分红，开启后相应等级的所有{:t('会员')}平均分摊设置的分红金额或比例</div>
								</div>
								{php}
								$gdfenhongdata1 = json_decode($info['gdfenhongdata1'],true);
								if(!$gdfenhongdata1) $gdfenhongdata1 = [];
								$gdfenhongdata2 = json_decode($info['gdfenhongdata2'],true);
								if(!$gdfenhongdata2) $gdfenhongdata2  = [];
								{/php}
								  <div diandaSwitchMulti="info[gdfenhongset]" data-val="1" {if $info['gdfenhongset']!=1}style="display:none"{/if}>
								  <div class="layui-form-item">
									  <label class="layui-form-label">分红比例：</label>
									  {if !$gdlevellist}<div class="layui-form-mid" style="color:red">未设置具有股东分红权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置</div>{/if}
									  {foreach $gdlevellist as $level}
									  <div class="layui-input-inline layui-module-itemL">
										  <div> {$level.name}(%) </div>
										  <input type="text" name="gdfenhongdata1[{$level.id}][commission]" class="layui-input" value="{$gdfenhongdata1[$level['id']]['commission']}">
									  </div>
									  {/foreach}
								  </div>
								  </div>
								  <div diandaSwitchMulti="info[gdfenhongset]" data-val="2" {if $info['gdfenhongset']!=2}style="display:none"{/if}>
								  <div class="layui-form-item">
									  <label class="layui-form-label">分红金额：</label>
									  {if !$gdlevellist}<div class="layui-form-mid" style="color:red">未设置具有股东分红权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置</div>{/if}
									  {foreach $gdlevellist as $level}
									  <div class="layui-input-inline layui-module-itemL">
										  <div> {$level.name}(元) </div>
										  <input type="text" name="gdfenhongdata2[{$level.id}][commission]" class="layui-input" value="{$gdfenhongdata2[$level['id']]['commission']}">
									  </div>
									  {/foreach}
								  </div>
								  </div>
								{/if}
								<!--股东分红end-->
								  
								<!--区域分红-->
								<div class="layui-form-item">
								  <label class="layui-form-label">区域代理分红：</label>
								  <div class="layui-input-block" style="width:850px">
									  <input type="radio" name="info[areafenhongset]" value="0" {if !$info['id'] || $info['areafenhongset']==0}checked{/if} title="按照会员等级" lay-filter="diandaSwitchMulti">
									  <input type="radio" name="info[areafenhongset]" value="1" {if $info['areafenhongset']==1}checked{/if} title="单独设置分红比例" lay-filter="diandaSwitchMulti">
									  <input type="radio" name="info[areafenhongset]" value="2" {if $info['areafenhongset']==2}checked{/if} title="单独设置分红金额" lay-filter="diandaSwitchMulti">
									  {if getcustom('fenhong_score_percent')}
									  <input type="radio" name="info[areafenhongset]" value="4" {if $info['areafenhongset']==4}checked{/if} title="单独设置分红{:t('积分')}比例" lay-filter="diandaSwitchMulti">
									  {/if}
									  <input type="radio" name="info[areafenhongset]" value="-1" {if $info['areafenhongset']==-1}checked{/if} title="不参与分红" lay-filter="diandaSwitchMulti">
								  </div>
								  <div class="layui-form-mid layui-word-aux">设置分红比例或分红金额后该等级的同一个代理区域的人平均分摊所有商城内该区域的订单的分红提成比例或分红金额</div>
								</div>
								{php}
								$areafenhongdata1 = json_decode($info['areafenhongdata1'],true);
								if(!$areafenhongdata1) $areafenhongdata1 = [];
								$areafenhongdata2 = json_decode($info['areafenhongdata2'],true);
								if(!$areafenhongdata2) $areafenhongdata2  = [];
								{/php}
								  <div diandaSwitchMulti="info[areafenhongset]" data-val="1" {if $info['areafenhongset']!=1}style="display:none"{/if}>
								  <div class="layui-form-item">
									  <label class="layui-form-label">分红比例：</label>
									  {if !$areafhlevellist}<div class="layui-form-mid" style="color:red">未设置具有区域代理分红权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置</div>{/if}
									  {foreach $areafhlevellist as $level}
									  <div class="layui-input-inline layui-module-itemL">
										  <div> {$level.name}(%) </div>
										  <input type="text" name="areafenhongdata1[{$level.id}][commission]" class="layui-input" value="{$areafenhongdata1[$level['id']]['commission']}">
									  </div>
									  {/foreach}
								  </div>
								  </div>
								  <div diandaSwitchMulti="info[areafenhongset]" data-val="2" {if $info['areafenhongset']!=2}style="display:none"{/if}>
								  <div class="layui-form-item">
									  <label class="layui-form-label">分红金额：</label>
									  {if !$areafhlevellist}<div class="layui-form-mid" style="color:red">未设置具有区域代理分红权限的{:t('会员')}等级，请先在[{:t('会员')}]-[等级及分销]设置</div>{/if}
									  {foreach $areafhlevellist as $level}
									  <div class="layui-input-inline layui-module-itemL">
										  <div> {$level.name}(元) </div>
										  <input type="text" name="areafenhongdata2[{$level.id}][commission]" class="layui-input" value="{$areafenhongdata2[$level['id']]['commission']}">
									  </div>
									  {/foreach}
								  </div>
								  </div>
								<!--区域分红end-->

								</div> <!--fenhongset end-->
								{/if}
								<!--分红设置 end-->
							  <!--团长分红 start-->
							  {if getcustom('tuanzhang_fenhong') && ($auth_data=='all' || in_array('Commission/tuanzhang_fenhonglog',$auth_data))}
							  <div class="layui-form-item">
								  <label class="layui-form-label">{:t('团长分红')}：</label>
								  <div class="layui-input-block" style="width:850px">
									  <input type="radio" name="info[tuanzhang_fenhong_set]" value="0" {if !$info['id'] || $info['tuanzhang_fenhong_set']==0}checked{/if} title="按会员等级" >
									  <input type="radio" name="info[tuanzhang_fenhong_set]" value="-1" {if $info['id'] && $info['tuanzhang_fenhong_set']==-1}checked{/if} title="不参与分红" >
								  </div>
								  <div class="layui-form-mid layui-word-aux"></div>
							  </div>
							  {/if}
							  <!--团长分红 end-->
								{if getcustom('restaurant_duli_buy')}
								<div class="layui-form-item">
									<label class="layui-form-label">独立购买：</label>
									<div class="layui-input-block" >
										<input type="radio" name="info[duli_buy]" value="0" {if !$info['id'] || $info['duli_buy']==0}checked{/if} title="关闭" lay-filter="duli_buy">
										<input type="radio" name="info[duli_buy]" value="1" {if $info['duli_buy']==1}checked{/if} title="开启" lay-filter="duli_buy">
									</div>
								</div>
								{/if}
									{if getcustom('one_buy_not_send')}
									<div class="layui-form-item">
										<label class="layui-form-label">单点不配送：</label>
										<div class="layui-input-block" >
											<input type="radio" name="info[one_buy_status]" value="0" {if !$info['id'] || $info['one_buy_status']==0}checked{/if} title="关闭" >
											<input type="radio" name="info[one_buy_status]" value="1" {if $info['one_buy_status']==1}checked{/if} title="开启" >
										</div>
									</div>
									{/if}
								  {if getcustom('yx_queue_free_restaurant_shop')}
								  <div class="layui-form-item">
									  <label class="layui-form-label">{:t('排队免单')}：</label>
									  <div class="layui-input-block" style="width:800px">
										  <input type="radio" name="info[queue_free_status]" value="1" {if  $info['queue_free_status']==1}checked{/if} title="参与">
										  <input type="radio" name="info[queue_free_status]" value="0" {if !$info['id'] || $info['queue_free_status']==0}checked{/if} title="不参与" >
									  </div>
								  </div>
								  {/if}
								  {if getcustom('restaurant_product_not_member_discount')}
								  <div class="layui-form-item">
									  <label class="layui-form-label">{:t('会员')}等级折扣：</label>
									  <div class="layui-input-inline" style="width: 220px">
										  <input type="radio" name="info[join_member_disount]" value="1" {if $info['join_member_disount']==1}checked{/if} title="参与"   >
										  <input type="radio" name="info[join_member_disount]" value="0" {if !$info['id'] || $info['join_member_disount']==0}checked{/if} title="不参与" >
									  </div>
									  <div class="layui-form-mid layui-word-aux">下单时该菜品是否参与{:t('会员')}折扣</div>
								  </div>
								  {/if}
									<div class="layui-form-item">
										<label class="layui-form-label">显示销量：</label>
										<div class="layui-input-inline">
											<input type="text" name="info[sales]" value="{$info['id']?$info['sales']:'0'}" class="layui-input">
											<input type="hidden" name="info[oldsales]" value="{$info['id']?$info['sales']:'0'}" class="layui-input">
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">起售数量：</label>
										<div class="layui-input-inline">
											<input type="number" name="info[limit_start]" value="{$info['id']?$info['limit_start']:'0'}" class="layui-input">
										</div>
										<div class="layui-form-mid layui-word-aux">多少份起卖，0表示不限购</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">每单限购：</label>
										<div class="layui-input-inline">
											<input type="number" name="info[limit_per]" min="0" value="{$info['id']?$info['limit_per']:'0'}" class="layui-input">
										</div>
										<div class="layui-form-mid layui-word-aux">每单最多可购买多少份，0表示不限购</div>
									</div>
									{if getcustom('restaurant_takeaway_limit')}
									<div class="layui-form-item">
										<label class="layui-form-label">外卖每人限购：</label>
										<div class="layui-input-inline">
											<input type="number" name="info[limit_takeaway]" min="0" value="{$info['id']?$info['limit_takeaway']:'0'}" class="layui-input">
										</div>
										<div class="layui-form-mid layui-word-aux">外卖每人合计最多可购买多少份，0表示不限购</div>
									</div>
									{/if}
								
									<div class="layui-form-item">
										<label class="layui-form-label">周几可点：</label>
										<div class="layui-input-block">
											<input type="checkbox" name="info[status_week][]" value="1" title="周一" {if (in_array(1, $info['status_week']))} checked=""{/if}>
											<input type="checkbox" name="info[status_week][]" value="2" title="周二" {if (in_array(2, $info['status_week']))} checked=""{/if}>
											<input type="checkbox" name="info[status_week][]" value="3" title="周三" {if (in_array(3, $info['status_week']))} checked=""{/if}>
											<input type="checkbox" name="info[status_week][]" value="4" title="周四" {if (in_array(4, $info['status_week']))} checked=""{/if}>
											<input type="checkbox" name="info[status_week][]" value="5" title="周五" {if (in_array(5, $info['status_week']))} checked=""{/if}>
											<input type="checkbox" name="info[status_week][]" value="6" title="周六" {if (in_array(6, $info['status_week']))} checked=""{/if}>
											<input type="checkbox" name="info[status_week][]" value="7" title="周日" {if (in_array(7, $info['status_week']))} checked=""{/if}>
										</div>
										<div class="layui-form-mid layui-word-aux">仅选择的日期可点</div>
									</div>
									{if getcustom('restaurant_product_showtj') }
									<div class="layui-form-item">
										<label class="layui-form-label">显示条件：</label>
										<div class="layui-input-inline" style="width:800px">
											{php}$info['showtj'] = explode(',',$info['showtj']);{/php}
											<input type="checkbox" name="info[showtj][]" value="-1" title="所有人" lay-skin="primary" {if !$info['id'] || in_array('-1',$info['showtj'])}checked{/if}/>
											<input type="checkbox" name="info[showtj][]" value="-2" title="未登录用户" lay-skin="primary" {if !$info['id'] || in_array('-2',$info['showtj'])}checked{/if}/>
											<input type="checkbox" name="info[showtj][]" value="0" title="关注用户" lay-skin="primary" {if in_array('0',$info['showtj'])}checked{/if}/>
											{foreach $levellist as $v}
											<input type="checkbox" name="info[showtj][]" value="{$v.id}" title="{$v.name}" lay-skin="primary" {if in_array($v['id'],$info['showtj'])}checked{/if}/>
											{/foreach}
										</div>
									</div>
									{/if}
									<div class="layui-form-item">
										<label class="layui-form-label">打包费：</label>
										<div class="layui-input-inline">
											<input type="text" name="info[pack_fee]" value="{$info['id']?$info['pack_fee']:'0'}" class="layui-input">
										</div>
										<div class="layui-form-mid layui-word-aux">打包费根据购买数量计算</div>
									</div>
  									{if getcustom('restaurant_product_stock_daily')}
									<div class="layui-form-item">
										<label class="layui-form-label">每日总库存：</label>
										<div class="layui-input-inline">
											<input type="text" name="info[total_stock_daily]" value="{$info['total_stock_daily']?$info['total_stock_daily']:'0'}" class="layui-input">
										</div>
										<div class="layui-form-mid layui-word-aux">每日总库存大于0的时候，规格的每日库存失效</div>
									</div>
									<div class="layui-form-item">
									  <label class="layui-form-label">每日总库存更新时间：</label>
									  <div class="layui-input-inline" >
										  <input type="text" name="info[stock_daily_time]" id="stock_daily_time" autocomplete="off" class="layui-input" value="{$info['stock_daily_time'] || default='00:00'}">
									  </div>
										<div class="layui-form-mid layui-word-aux">每日总库存自定义更新时间，默认0点更新</div>
									</div>
  									{/if}
									<div class="layui-form-item">
									  <label class="layui-form-label">序号：</label>
									  <div class="layui-input-inline">
										  <input type="text" name="info[sort]" value="{$info['id']?$info['sort']:'0'}" class="layui-input">
									  </div>
									  <div class="layui-form-mid layui-word-aux">用于排序,越大越靠前</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">状态：</label>
										<div class="layui-input-inline" style="width:600px">
											<input type="radio" name="info[status]" value="1" title="已上架" {if !$info['id'] || $info['status']==1}checked{/if} lay-filter="set_status"/>
											<input type="radio" name="info[status]" value="0" title="未上架" {if $info['id'] && $info['status']==0}checked{/if} lay-filter="set_status"/>
											<input type="radio" name="info[status]" value="2" title="设置上架时间" {if $info['id'] && $info['status']==2}checked{/if} lay-filter="set_status"/>
											<input type="radio" name="info[status]" value="3" title="设置上架周期" {if $info['id'] && $info['status']==3}checked{/if} lay-filter="set_status"/>
										</div>
									</div>
									
									<div class="layui-form-item" id="set_status2" {if $info['status']!=2}style="display:none"{/if}>
										<label class="layui-form-label">上架时间：</label>
										<div class="layui-input-inline" style="width:150px">
											<input type="text" name="info[start_time]" class="layui-input" value="{$info.start_time}" id="start_time" autocomplete="off">
										</div>
										<div class="layui-form-mid">到</div>
										<div class="layui-input-inline" style="width:150px">
											<input type="text" name="info[end_time]" class="layui-input" value="{$info.end_time}" id="end_time" autocomplete="off">
										</div>
										<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:110px"></div>
									</div>
									<div class="layui-form-item" id="set_status3" {if $info['status']!=3}style="display:none"{/if}>
										<label class="layui-form-label">上架周期：</label>
										<div class="layui-input-inline" style="width:150px">
											<input type="text" name="info[start_hours]" class="layui-input" value="{$info.start_hours}" id="start_hours" autocomplete="off">
										</div>
										<div class="layui-form-mid">到</div>
										<div class="layui-input-inline" style="width:150px">
											<input type="text" name="info[end_hours]" class="layui-input" value="{$info.end_hours}" id="end_hours" autocomplete="off">
										</div>
										<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:110px">结束时间小于或等于开始时间表示跨天,如:16:00到06:00表示下午4点到次日早晨6点</div>
									</div>
									
									<div class="layui-form-item">
										<label class="layui-form-label"></label>
										<div class="layui-input-block">
											<button class="layui-btn layui-btn-normal" onclick="gonext(2)">下一步:编辑菜品详情</button>
											<button class="layui-btn layui-btn-danger" lay-submit lay-filter="formsubmit">提 交</button>
										</div>
									</div>

								</div>
								<div class="layui-tab-item">
									<!-- 详情编辑器 -->
									<!-- <div class="layui-form-item">
										<label class="layui-form-label">菜品详情</label>
										<div class="layui-input-inline" style="width:500px">
											<script id="content" name="info[detail]" type="text/plain" style="width:100%;height:500px">{$info['detail']}</script>
										</div>
									</div> -->
									<!-- 详情编辑器 -->
									{if $info['detail_text'] || $info['detail_pics']}
									<div class="layui-form-item">
										<label class="layui-form-label">菜品详情(文本)：</label>
										<div class="layui-input-inline" style="width:500px">
											<textarea name="info[detail_text]" placeholder="请输入菜品详情内容" class="layui-textarea">{$info.detail_text}</textarea>
										</div>
									</div>
									<div class="layui-form-item">
										<label class="layui-form-label">菜品详情(图片)：</label>
										<input type="hidden" name="info[detail_pics]" value="{$info['detail_pics']}" id="detail_pics">
										<button style="float:left;" type="button" class="layui-btn layui-btn-primary" onclick="uploader(this,true)" upload-input="detail_pics" upload-preview="detail_picsPreview" >批量上传</button>
										<div class="layui-form-mid layui-word-aux" style="margin-left:10px;"></div>
										<div id="detail_picsPreview" class="picsList-class-padding">
											{if $info['detail_pics']}{php}$pics = explode(',',$info['detail_pics']);{/php}{foreach $pics as $pic}
											<div class="layui-imgbox">
												<a class="layui-imgbox-close" href="javascript:void(0)" onclick="$(this).parent().remove();getpicsval('detail_pics','detail_picsPreview')" title="删除"><i class="layui-icon layui-icon-close-fill-opaque"></i></a>
												<span class="layui-imgbox-img"><img src="{$pic}"></span>
											</div>
											{/foreach}{/if}
										</div>
									</div>
									{/if}
									<?php
									$pagetitle='菜品详情';
									$pagedata= $info['detail'] && json_decode($info['detail']) ? $info['detail'] : '[{"id":"M0000000000000","temp":"richtext","params":{bgcolor:"#FFFFFF",margin_x:"0",margin_y:"0",padding_x:"10",padding_y:"10","quanxian":{"all":true},"platform":{"all":true}},"data":"","other":"","content":""}]';
									?>
									{include file="designer_page/designer_editor" /}

									<div class="layui-form-item">
										<label class="layui-form-label"></label>
										<div class="layui-input-block">
											<button class="layui-btn layui-btn-normal" onclick="gonext(1)">上一步:编辑菜品信息</button>
											<button class="layui-btn layui-btn-danger" lay-submit lay-filter="formsubmit">提 交</button>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
  </div>
	<video id="myvideo" style="display:none"></video>
	<script>
		layui.form.verify({
			positiveNumberRequiredTrue:[/^(([0-9]+[\.]?[0-9]+)|[1-9])$/,'只能填写正数'],//必填，且只能输入正数
		})
		var formSelects = layui.formSelects;

	$(".layui-form input#video").bind("input change propertychange",function(event){
		var videourl = $('#video').val();
		if(videourl){
			$("#myvideo").prop("src", videourl);
			$("#myvideo")[0].addEventListener("loadedmetadata", function() {
				var tol = Math.floor(this.duration); //获取总时长
				$('#video_duration').val(tol);
			});
		}else{
			$('#video_duration').val(0);
		}
	})
	//var ueditor = UE.getEditor('content');
	layui.form.on('radio(freighttypeset)', function(data){
		if(data.value == '1'){
			$('#setfreight').hide();
		}else{
			$('#setfreight').show();
		}
	})
	layui.form.on('radio(product_type)', function(data){
		 if(data.value == '2'){
			$('#weight_type_tip').hide();
			$('#package_type_tip').show();
			$('#package_div').show();
			$('#setgg').hide();
			$('#product_jialiao').hide();
		}else if(data.value == '1'){
			$('#weight_type_tip').show();
			$('#package_type_tip').show();
			 $('#package_div').hide();
			 $('#setgg').show();
			 $('#product_jialiao').show();
		} else {
			$('#weight_type_tip').hide();
			$('#package_type_tip').hide();
			$('#package_div').hide();
			$('#setgg').show();
			 $('#product_jialiao').show();
		}
	})
		
	layui.form.on('switch(isfuwu)',function(data){
		if(data.elem.checked){
			$('#isfuwudiv').show();
		}else{
			$('#isfuwudiv').hide();
		}
	})
	layui.form.on('radio(commissionset)', function(data){
		if(data.value == '1'){
			$('#commissionset1').show();
			$('#commissionset2').hide();
			$('#commissionset3').hide();
		}else if(data.value == '2'){
			$('#commissionset1').hide();
			$('#commissionset2').show();
			$('#commissionset3').hide();
		}else if(data.value == '3'){
			$('#commissionset1').hide();
			$('#commissionset2').hide();
			$('#commissionset3').show();
		}else{
			$('#commissionset1').hide();
			$('#commissionset2').hide();
			$('#commissionset3').hide();
		}
	});
	layui.form.on('radio(scored_set)', function(data){
		if(data.value == '1'){
			$('#scored_set1').show();
			$('#scoredkmaxunit').html('%');
		}else if(data.value == '2'){
			$('#scored_set1').show();
			$('#scoredkmaxunit').html('元');
		}else{
			$('#scored_set1').hide();
		}
	})
	
	layui.laydate.render({ 
		elem: '#start_hours',
		type: 'time',
		format:'HH:mm',
		trigger: 'click'
	});
	layui.laydate.render({ 
		elem: '#end_hours',
		type: 'time',
		format:'HH:mm',
		trigger: 'click'
	});
	layui.laydate.render({ 
		elem: '#start_time',
		type: 'datetime',
		trigger: 'click'
	});
	layui.laydate.render({ 
		elem: '#end_time',
		type: 'datetime',
		trigger: 'click'
	});
	layui.form.on('radio(set_status)',function(data){
		if(data.value=="0" || data.value=="1"){
			$('#set_status2').hide();
			$('#set_status3').hide();
		}
		if(data.value=="2"){
			$('#set_status2').show();
			$('#set_status3').hide();
		}
		if(data.value=="3"){
			$('#set_status2').hide();
			$('#set_status3').show();
		}
	});
	function gonext(layid){
		$(window).scrollTop(0);
		layui.element.tabChange('mytab', layid);
	}
	layui.element.on('tab(mytab)', function(){
		try{
			changeconentxy();
		}catch(e){}
	})
	//var ueditor = UE.getEditor('editor');
	//售卖加料
	function addjialiao(){
		var num	= $('#jlnamediv').find('tr').length;
		 if(num >= 11){
		 	 layer.alert('最多添加10个');
		 	 return;
		 }
		var gghtml = '<tr>';
		gghtml += '<td ><input type="text" class="layui-input" name="jltitle" value="" placeholder="请输入加料名称" lay-verify="" /></td>';
		gghtml += '<td ><input type="number" class="layui-input" name="price" value="0.00" placeholder="请输入价格" lay-verify="" min="0"></td>';
		gghtml += '<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td>';
		gghtml += '</tr>';
		$('#jlnamediv').append(gghtml);
	}	
	
	var oldgglist = {:json_encode($guige_list)};
	$(function(){
		 refreshgg();
	})
	function addggtype(){
		var gghtml = '<tr>';
		gghtml += '<td><input type="text" name="ggname" class="layui-input" value="" style="width:120px" placeholder="请输入规格分组"/></td>';
		gghtml += '<td><div><input type="text" class="layui-input" style="width:180px" value="" placeholder="请输入规格名称"> <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="addggname(this)" style="margin-top:-3px;"><i class="fa fa-plus" style="font-size:14px!important"></i></button></div></td>';
		gghtml += '<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td>';
		gghtml += '</tr>';
		$('#ggnamediv').append(gghtml);
	}
	function addggname(obj){
		var ggnameobj = $(obj).parent().parent().append('<div><input class="layui-input" type="text" style="width:180px" value="" placeholder="请输入规格名称"> <button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().remove()" style="margin-top:-3px;"><i class="fa fa-remove" style="font-size:14px!important"></i></button></div>');
	}
	function lvpriceset(){
		var lvprice = $("input[name='info[lvprice]']").val();
		if(lvprice == 0){
			$("input[name='info[lvprice]']").val('1');
			$('#lvpricebtn').text('关闭会员价');
			$('#commissionset4input').show();
			$('#commissionset4tips').show();
			//layui.form.render();
		}else{
			$("input[name='info[lvprice]']").val('0');
			$('#lvpricebtn').text('开启会员价');
			$('#commissionset4input').hide();
			$('#commissionset4tips').hide();
		}
		refreshgg()
	}
	var specs = [];
	function refreshgg(){
		var haskong = 0
		$('#ggnamediv').find("input").each(function(){
			if($(this).val()=='') haskong = 1
		})
		if(haskong){
			layer.msg('请填写完整');return;
		}
		var lvprice = $("input[name='info[lvprice]']").val();
		specs = [];
		var i=0;
		$('input[name=ggname]').each(function(){
			var ggval = [];
			var j=0;
			$(this).parent().next().find('input').each(function(){
				ggval.push({ 'k':j,'title':$(this).val()});
				j++
			})
			specs.push({ 'k':i,'title':$(this).val(),'items':ggval});
			i++;
		});
		console.log(specs)
		var len = specs.length;
		var newlen = 1;
		var h = new Array(len);
		var rowspans = new Array(len);

		var html = '<thead><tr>';
		for(var i=0;i<len;i++){
			html+="<th>" + specs[i].title + "</th>";
			var itemlen = specs[i].items.length;
			if(itemlen<=0) { itemlen = 1 };
			newlen*=itemlen;
			h[i] = new Array(newlen);
			for(var j=0;j<newlen;j++){
				h[i][j] = new Array();
			}
			var l = specs[i].items.length;
			rowspans[i] = 1;
			for(j=i+1;j<len;j++){
				rowspans[i]*= specs[j].items.length;
			}
		}
		html += '<th>规格编号</th>';
		html += '<th>市场价（元）</th>';
		html += '<th>成本价（元）</th>';
		if(lvprice==1){
			{foreach $levellist as $level}
			html += '<th>{$level.name}（元）</th>';
			{/foreach}
			}else{
				html += '<th>销售价（元）</th>';
			}
			html += '<th>每日库存</th>';
			html += '<th>总库存</th>';
			{if $bid==0}
			html += '<th>赠{:t('积分')}(个)</th>';
			{/if}
					html += '<th>图片</th>';
					{if getcustom('restaurant_product_guige_hide')}
					html += '<th>禁选规格</th>';
					{/if}	
					html += '</tr></thead>';

					for(var m=0;m<len;m++){
						var k = 0,kid = 0,n=0;
						for(var j=0;j<newlen;j++){
							var rowspan = rowspans[m];
							if( j % rowspan==0){
								h[m][j]={ k:specs[m].items[kid].k,title: specs[m].items[kid].title, html: "<td rowspan='" +rowspan + "'>"+ specs[m].items[kid].title+"</td>\r  ",id: specs[m].items[kid].id};
							}else{
								h[m][j]={ k:specs[m].items[kid].k,title:specs[m].items[kid].title, html: "",id: specs[m].items[kid].id};
							}
							n++;
							if(n==rowspan){
								kid++; if(kid>specs[m].items.length-1) { kid=0; }
								n=0;
							}
						}
					}

					var hh = "";
					for(var i=0;i<newlen;i++){
						hh+="<tr>";
						var ks = [];
						var titles = [];
						for(var j=0;j<len;j++){
							hh+=h[j][i].html;
							ks.push( h[j][i].k);
							titles.push( h[j][i].title);
						}
						ks2 =ks.join('_');
						ks =ks.join(',');
						titles =titles.join(',');
						if(typeof(oldgglist[ks])!='undefined'){
							var val = oldgglist[ks];
						}else{
							var val = { market_price:'',cost_price:'',sell_price:'',stock:'1000',givescore:'0',pic:'',lvprice_data:null};
						}

						//hh += '<td>';
						//hh += '	<input name="option['+ks+'][procode]" class="layui-input" type="text" style="width:100px" value="'+(val.procode==null?'':val.procode)+'"/>';
						//if(i==0){
						//	hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'procode\')"></i>';
						//}
						// hh += '</td>';
						hh += '<td>';
						hh += '	<input name="option['+ks+'][barcode]" class="layui-input" type="text" style="width:100px" value="'+(val.barcode==null?'':val.barcode)+'"/>';
						// if(i==0){
						// 	hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'barcode\')"></i>';
						// }
						// hh += '</td>';
						hh += '<td>';
						hh += '	<input name="option['+ks+'][name]" type="hidden" value="'+titles+'" class="layui-input"/><input name="option['+ks+'][market_price]" type="text" class="layui-input" style="width:70px" value="'+(val.market_price==null?'':val.market_price)+'"/>';
						if(i==0){
							hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'market_price\')"></i>';
						}
						hh += '</td>';
						hh += '<td>';
						hh += '	<input name="option['+ks+'][cost_price]" type="text" class="layui-input" style="width:70px" value="'+(val.cost_price==null?'':val.cost_price)+'"/>';
						if(i==0){
							hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'cost_price\')"></i>';
						}
						hh += '</td>';
						if(lvprice==1){
							{foreach $levellist as $lk=>$level}
							hh += '<td>';
							hh += '	<input name="option['+ks+'][sell_price_{$level.id}]" type="text" style="width:70px" value="'+(val.lvprice_data==null || val.lvprice_data[{$level.id}]==null?'':val.lvprice_data[{$level.id}])+'" class="layui-input" id="levelprice_'+i+'_{$lk}"/>';
							if(i==0){
								{if $lk==0}
								hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'sell_price_{$level.id}\')"></i>';
								{else}
								hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plsetlevelprice(\''+i+'\',\'{$lk}\')"></i>';
								{/if}
								}
								hh += '</td>';
								{/foreach}
								}else{
									hh += '<td>';
									hh += '	<input name="option['+ks+'][sell_price]" type="text" style="width:70px" value="'+(val.sell_price==null?'':val.sell_price)+'" class="layui-input"/>';
									if(i==0){
										hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'sell_price\')"></i>';
									}
									hh += '</td>';
								}
								
								hh += '<td>';
								hh += ' <input name="option['+ks+'][stock_daily]" type="number" min="0" style="width:60px" value="'+(val.stock_daily<=0?'0':val.stock_daily)+'" class="layui-input"/>';
								if(i==0){
									hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'stock_daily\')"></i>';
								}
								hh += '</td>';
							
								hh += '<td>';
								hh += ' <input name="option['+ks+'][stock]" type="text" style="width:60px" value="'+(val.stock==null?'':val.stock)+'" class="layui-input"/>';
								if(i==0){
									hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'stock\')"></i>';
								}
								hh += '</td>';
								{if $bid==0}
								hh += '<td>';
								hh += ' <input name="option['+ks+'][givescore]" type="text" style="width:60px" value="'+(val.givescore==null?'':val.givescore)+'" class="layui-input"/>';
								if(i==0){
									hh += ' <i class="fa fa-hand-o-down" style="cursor:pointer" title="批量设置" onclick="plset(\'givescore\')"></i>';
								}
								hh += '</td>';
								{/if}
									
										hh += '<td id="ggpic'+ks2+'"><input type="hidden" name="option['+ks+'][pic]" id="ggpicval'+ks2+'" value="'+(val.pic==null?'':val.pic)+'"/><div class="guigeimg"><img class="thumb_img" src="'+(val.pic==null?'':val.pic)+'" style="max-width:50px;"/><a class="layui-imgbox-close guigeimg_close" style="'+(val.pic=='' ||val.pic==null?'display:none':'display:block')+'"    href="javascript:void(0)" onclick="$(this).prev(\'.thumb_img\').attr(\'src\',\'\');$(this).parent().prev(\'input\').val(\'\');$(this).hide();" title="删除"><i class="layui-icon layui-icon-close-fill-opaque"></i></a></div> <button class="layui-btn layui-btn-sm layui-btn-primary" onclick="uploader(this)" upload-input="ggpicval'+ks2+'" upload-preview="ggpic'+ks2+'" type="button">上传</button></td>';
										{if getcustom('restaurant_product_guige_hide')}
										hh += '<td> <input type="checkbox" name="option['+ks+'][show_status]" value="1" lay-text="是|否" lay-skin="switch" '+(val.show_status==1?'checked':'')+' style="width: 70px"></td>';
									
										{/if}
										hh += "</tr>";
									}
									html+=hh;
									$("#ggvaldiv").html(html);
									layui.form.render();
								}
								function plset(name){
									if(name =='procode'){
										var procode = $("input[name$='["+name+"]']").eq(0).val();
										if(procode == '') procode = randomString(6);
										$("input[name$='["+name+"]']").each(function(i,v){
											if(i>0) $(this).val(procode+ '-'+i);
										})
									}else{
										$("input[name$='["+name+"]']").val($("input[name$='["+name+"]']").eq(0).val());
									}
								}
								function plsetlevelprice(i,k){
									var thisprice = $('#levelprice_'+i+'_'+k).val();
									console.log(thisprice)
									var level0price = $('#levelprice_0_0').val();
									console.log(level0price)
									var pricepercent = thisprice / level0price;
									console.log(pricepercent)
									$("input[name$='][market_price]']").each(function(i2,v2){
										var this_price = ($('#levelprice_'+i2+'_0').val() * pricepercent).toFixed(2);
										console.log(this_price)
										this_price = parseInt(this_price*100)/100;
										$('#levelprice_'+i2+'_'+k).val(this_price);
									})
								}
								function randomString(len) {
									len = len || 32;
									var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
									var maxPos = $chars.length;
									var pwd = '';
									for (i = 0; i < len; i++) {
										pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
									}
									return pwd;
								}

								layui.form.on('checkbox(gettjset)', function(data){
									console.log(data)
									if(data.elem.checked){
										$('#gettjset').hide();
									}else{
										$('#gettjset').show();
									}
								});
								var chooseUrlField = '';
								function chooseUrl2(field){
									chooseUrlField = field;
									layer.open({type:2,shadeClose:true,area:['1200px', '650px'],'title':'选择链接',content:"{:url('DesignerPage/chooseurl')}&callback=chooseLink2"})
								}
								function chooseLink2(urlname,url){
									$("#"+chooseUrlField).val(url);
								}

								function showChooseCategory(){
									layer.open({type:2,title:'选择类目',content:"{:url('Wxvideo/allcategory')}&ischoose=1",area:['900px','600px'],shadeClose:true});
								}
								function chooseCategory(data){
									console.log(data)
									$("input[name='info[wxvideo_third_cat_id]']").val(data.third_cat_id);
								}

								/**
								 * 1.监听select的选中与取消
								 *
								 * formSelects.on(ID, Function);
								 *
								 * @param ID        xm-select的值
								 * @param Function  自定义处理方法
								 * @param isEnd     是否获取实时数据, true/false
								 */
								var formSelects = layui.formSelects;
								var paramdata='{$info[\'paramdata\']}';
								// console.log('paramdata')
								// console.log(paramdata)
								formSelects.on('selectCid', function(id, vals, val, isAdd, isDisabled){
									//console.log($("input[name='info[cid]']").val())
									var cid = $("input[name='info[cid]']").val();
									$.post("{:url('getParam')}",{cid:cid},function(data){
										if(data.status == 1){
											var paramlist = data.paramlist;
											var html = '';
											for(var i=0;i<paramlist.length;i++){
												html += '<div class="layui-form-item">';
												html += '	<label class="layui-form-label">';
												if(paramlist[i]['is_required']==1) html += '<span class="redstar">*</span>';
												html += paramlist[i]['name'];html += '：</label>';
												if(paramlist[i]['type']=='0'){
													html += '<div class="layui-input-inline" style="width:240px">';
													html += '<input type="text" class="layui-input" name="paramdata['+paramlist[i]['name']+']" ';
													if(typeof (paramdata[paramlist[i]['name']]) != 'undefined')
														html +=' value="'+ paramdata[paramlist[i]['name']]+'"';
													if(paramlist[i]['is_required']==1) html += ' lay-verify="required" lay-verType="tips"';
													html += ' placeholder="'+paramlist[i]['tips']+'"/>';
													html += '</div>';
												}else if(paramlist[i]['type']=='1'){
													html += '<div class="layui-input-inline" style="width:240px">';
													html += '	<select name="paramdata['+paramlist[i]['name']+']"';
													if(paramlist[i]['is_required']==1) html += ' lay-verify="required" lay-verType="tips"';
													html += '	>';
													html += '<option value="">'+paramlist[i]['tips']+'</option>';
													//console.log(paramlist[i]['params'])
													var parsms = JSON.parse(paramlist[i]['params']);
													for(var j=0;j<parsms.length;j++){
														if (paramdata[paramlist[i]['name']] == parsms[j]){
															html += '<option selected>'+parsms[j]+'</option>';
														}else{
															html += '<option>'+parsms[j]+'</option>';
														}
													}
													html += '</select></div>';
												}else if(paramlist[i]['type']=='2'){
													html += '<div class="layui-input-inline" style="width:240px">';
													var parsms = JSON.parse(paramlist[i]['params']);
													for(var j=0;j<parsms.length;j++){
														html += '<input type="checkbox" name="paramdata['+paramlist[i]['name']+'][]" value="'+parsms[j]+'" title="'+parsms[j]+'" lay-skin="primary" ';
														if(Array.isArray(paramdata[paramlist[i]['name']]) && paramdata[paramlist[i]['name']].indexOf(parsms[j]) != -1) html += ' checked';
														html += ' />';
													}
													html += '</div>';
													html += '<div class="layui-form-mid layui-word-aux" style="clear:left;margin-left:130px">{$param.tips}</div>';
												}

												html += '</div>';

											}
											if(paramlist.length == 0){
												html = '<div class="layui-form-item"><label class="layui-form-label"></label><div class="layui-form-mid">暂未添加商品参数或当前商品分类下无参数，<a href="javascript:void(0)" onclick="openmax(\'{:url(\'ShopParam/index\')}&isopen=1\')">去添加</a></div></div>';
											}
// console.log(html);
											$(".paramTab").html(html);

											layui.form.render();
										}
									})
									//id:           点击select的id
									//vals:         当前select已选中的值
									//val:          当前select点击的值
									//isAdd:        当前操作选中or取消
									//isDisabled:   当前选项是否是disabled

									//如果return false, 那么将取消本次操作
									// return false;
								},true);
	
</script>

<script>
	{if getcustom('product_jialiao')}
	function getjialiao(){
		var jldata = [];
		var i=0;
		$('input[name=jltitle]').each(function(){
			var price=	$(this).parent().next().find('input').val();
			jldata.push({'jltitle':$(this).val(),'price':price});
			i++;
		});
		return   jldata;
	}
	{/if}
	layui.form.on('submit(formsubmit)', function(obj){
		var field = obj.field
		field.specs = JSON.stringify(specs)
		{if getcustom('product_jialiao')}
		var jldata=getjialiao();
	
		 field.jldata = JSON.stringify(jldata)
		{/if}
		//field['info[detail]'] = ueditor.getContent();
		field['info[detail]'] = geteditordata();
		//console.log(field);return;
		if(field['info[freighttype]'] == 0 && field['info[freightdata]'] == ''){
			dialog('请选择运费模板');
			return;
		}
		var index = layer.load();
		$.post("{:url('save')}",field,function(data){
			layer.close(index);
			dialog(data.msg,data.status);
			if(data.status == 1){
				setTimeout(function(){
					parent.layer.closeAll();
					parent.tableIns.reload()
				},1000)
			}
		})
	})
  </script>
<script>
  //添加套餐	
  var packagekey = '';
  var istogg;
  var  makelayer;
  layui.form.on('radio(package_type)', function(data){
	  if(data.value == '2'){
		  $(this).parent().siblings('.select_num').show()
	  } else {
		  $(this).parent().siblings('.select_num').hide()
	  }
  })
  var chooseProductLayer;
  function showChooseProduct(){
	  chooseProductLayer = layer.open({type:2,title:'选择菜品',content:"{:url('RestaurantProduct/chooseproduct')}/hidebid/1/type/1",area:['1000px','600px'],shadeClose:true});
  }

  function choosepro(data) {
  	   console.log(istogg,'istogg');
      if(istogg ==0){
		  showgg(data.product,data.guigedata,data.gglist);
	  }else{
      	console.log(data,'data');
           var   proid = data.product.id;
           var proname = data.product.name;
           var sell_price = data.product.sell_price;
           var ggid = 0;
           var ggname = '所有规格';
		
		  var html = '';
		  html +='<tr class="productlisttr">' +
				  '<td><input type="hidden" name="product[proid]['+packagekey+'][]" value="'+proid+'">'+proid+'</td>' +
				  '<td><input type="hidden" name="product[proname]['+packagekey+'][]" value="'+proname+'">'+proname+'</td>' +
				  '<td><input type="hidden" name="product[ggid]['+packagekey+'][]" value="'+ggid+'"><input type="hidden" name="product[guigename]['+packagekey+'][]" value="'+ggname+'">'+ggname+'</td>' +
				  '<td><input type="hidden" name="product[sell_price]['+packagekey+'][]" value="'+sell_price+'">'+sell_price+'</td>' +
				  '<td><input type="number" class="layui-input" name="product[num]['+packagekey+'][]" min="1" value="1" style="width: 80px"></td>'+
				  '<td><input type="number" class="layui-input" name="product[add_price]['+packagekey+'][]" min="0" value="0" style="width: 80px"></td>'+
				  '<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td></tr>';
		  $(".product_table"+packagekey).append(html);
  	 }
      
  }

  var ggLayer;
  function showgg(product,specs,gglist){
	  var len = specs.length;
	  var newlen = 1;
	  var h = new Array(len);
	  var rowspans = new Array(len);
	  var mid = $("input[name='mid']").val();

	  var html = '<div style="margin:10px"><table id="ggvaldiv" class="layui-table"><thead><tr>';
	  for(var i=0;i<len;i++){
		  html+="<th>" + specs[i].title + "</th>";
		  var itemlen = specs[i].items.length;
		  if(itemlen<=0) { itemlen = 1 };
		  newlen*=itemlen;
		  h[i] = new Array(newlen);
		  for(var j=0;j<newlen;j++){
			  h[i][j] = new Array();
		  }
		  var l = specs[i].items.length;
		  rowspans[i] = 1;
		  for(j=i+1;j<len;j++){
			  rowspans[i]*= specs[j].items.length;
		  }
	  }
	  html += '<th>库存</th>';
	  html += '<th>市场价</th>';
	  html += '<th>销售价</th>';
	  html += '<th>操作</th>';
	  html += '</tr></thead>';

	  for(var m=0;m<len;m++){
		  var k = 0,kid = 0,n=0;
		  for(var j=0;j<newlen;j++){
			  var rowspan = rowspans[m];
			  if( j % rowspan==0){
				  h[m][j]={ k:specs[m].items[kid].k,title: specs[m].items[kid].title, html: "<td rowspan='" +rowspan + "'>"+ specs[m].items[kid].title+"</td>\r  ",id: specs[m].items[kid].id};
			  }else{
				  h[m][j]={ k:specs[m].items[kid].k,title:specs[m].items[kid].title, html: "",id: specs[m].items[kid].id};
			  }
			  n++;
			  if(n==rowspan){
				  kid++; if(kid>specs[m].items.length-1) { kid=0; }
				  n=0;
			  }
		  }
	  }
	  var hh = "";
	  for(var i=0;i<newlen;i++){
		  hh+="<tr>";
		  var ks = [];
		  var titles = [];
		  for(var j=0;j<len;j++){
			  hh+=h[j][i].html;
			  ks.push( h[j][i].k);
			  titles.push( h[j][i].title);
		  }
		  ks =ks.join(',');
		  titles =titles.join(',');
		  if(typeof(gglist[ks])!='undefined'){
			  var val = gglist[ks];
		  }else{
			  var val = { procode:'',market_price:'',cost_price:'',sell_price:'',weight:'',stock:'1000',pic:''};
		  }
			  hh += '<td>'+val.stock+'</td>';
			  hh += '<td>'+val.market_price+'</td>';
			  hh += '<td>'+val.sell_price+'</td>';
			  hh += '<td>';
			  // hh += ' <input name="buynum" ggid="'+val['id']+'" sellprice="'+val['sell_price']+'" ggname="'+val['name']+'" type="num" style="width:80px" value="0" class="layui-input"/>';
			  hh +='<button class="table-btn"  onclick="chooseguige(\''+product['id']+'\',\''+product['name']+'\',\''+val['sell_price']+'\',\''+val['name']+'\',\''+val['id']+'\')">选择</button>';
			  hh += '</td>';
			  hh += "</tr>";
		  }
		  html+=hh;
		  html+='</table></div>';
	  ggLayer = layer.open({type:1,title:product.name,content:html,area:['900px','600px'],shadeClose:true,btn:['返回','确定'],
			  yes:function(index){
				  layer.close(chooseProductLayer);
				  layer.close(ggLayer);
				 layer.open({type:2,title:'选择菜品',content:"{:url('RestaurantProduct/chooseproduct')}/hidebid/1",area:['1000px','600px'],shadeClose:true});
			  }
		  });
	  }
  function chooseguige(proid,proname,sell_price,ggname,ggid) {
	if(packagekey !== ''){
		var html = '';
		html +='<tr class="productlisttr">' +
				'<td><input type="hidden" name="product[proid]['+packagekey+'][]" value="'+proid+'">'+proid+'</td>' +
				'<td><input type="hidden" name="product[proname]['+packagekey+'][]" value="'+proname+'">'+proname+'</td>' +
				'<td><input type="hidden" name="product[ggid]['+packagekey+'][]" value="'+ggid+'"><input type="hidden" name="product[guigename]['+packagekey+'][]" value="'+ggname+'">'+ggname+'</td>' +
				'<td><input type="hidden" name="product[sell_price]['+packagekey+'][]" value="'+sell_price+'">'+sell_price+'</td>' +
				'<td><input type="number" class="layui-input" name="product[num]['+packagekey+'][]" min="1" value="1" style="width: 80px"></td>'+
				'<td><input type="number" class="layui-input" name="product[add_price]['+packagekey+'][]" min="0" value="0" style="width: 80px"></td>'+
				'<td><button type="button" class="layui-btn layui-btn-sm layui-btn-primary" onclick="$(this).parent().parent().remove()">删除</button></td></tr>';
		$(".product_table"+packagekey).append(html);
	}else{
	
	}

  }

  function addpackagelist(){
		var html='';
	  var packagenum = $('.packagelist').length;
	 
	  html+='<div class="layui-form-item packagelist" style="margin-left:125px ">  ' +
			  '		<div class="layui-form-item"><label class="layui-form-label" style="width: 75px;padding-left: 0">分类名称：</label><input type="text" name="category_name['+packagenum+']" lay-vertype="tips" class="layui-input" value="" style="width: 200px;display: inline-block"></div>' +
			  '		<div class="layui-form-item" >' +
			  '      	<label class="layui-form-label" style="width: 75px;padding-left: 0">套餐类型：</label>' +
			  '      	<input type="radio" name="package_type['+packagenum+']" value="0" checked="true"  title="固定" lay-filter="package_type" >' +
			  '      	<input type="radio" name="package_type['+packagenum+']" value="1"   title="单选" lay-filter="package_type">' +
			  '      	<input type="radio" name="package_type['+packagenum+']" value="2"   title="多选" lay-filter="package_type">' +
			  '     </div>'+
			  '		<div class="layui-form-item select_num"  style="display: none">' +
			  '      	<label class="layui-form-label" style="width: 75px;padding-left: 0">选择数量：</label>' +
			  '      	<div class="layui-input-inline" style="width:300px">' +
			  '      		<input type="number"  name="selectnum[]" min="0" value="" lay-vertype="tips" autocomplete="off" class="layui-input">' +
			  '      	</div>' +
			  '     </div>'+
			  '<label class="layui-form-label" style="width: 75px;padding-left: 0">已选菜品：</label>'+
			  '     <table   class="layui-table" style="width:650px">  ' +
			  '     	<thead>  ' +
			  '     	<tr>  ' +
			  '     	<th>商品ID</th>  ' +
			  '     	<th>商品名称</th>  ' +
			  '     	<th>规格名称</th>  ' +
			  '     	<th>价格</th>  ' +
			  '     	<th>份数</th>  ' +
			  '     	<th>加价</th>  ' +
			  '     	<th>操作</th>  ' +
			  '     	</tr>  ' +
			  '     	</thead> ' +
			  '			<tbody class="product_table'+packagenum+'">'+
			  '			</tbody>    ' +
			  '			<tr id="productaddtr">  ' +
			  '      	<td colspan="7" style="text-align:center;"><button type="button" class="layui-btn layui-btn-normal" onclick="showChooseProduct3('+packagenum+',1)">添加定制菜品</button><button type="button" class="layui-btn" onclick="showChooseProduct3('+packagenum+')">添加普通菜品</button></td>' +
			  '    </tr>  ' +
			  '    </table>  <button type="button" class="layui-btn layui-btn-warm" onclick="$(this).parent().html(\'\')" style="margin-left: 90px">移除</button>' +
			  '    </div>';
	 
	  $('#packpagelist').append(html);
	  layui.form.render('radio');
  }
  //istogg 1:直接选择商品不选规格，0选择商品和规格

  function showChooseProduct3(packagekey1,istogg1=0){
	  packagekey = packagekey1;
	  istogg =   istogg1;
	  console.log(istogg,'istogg2222');
	   layer.open({type:2,title:'选择菜品',content:"{:url('RestaurantProduct/chooseproduct')}",area:['1000px','600px'],shadeClose:true});
  }
{if getcustom('restaurant_fenhong') &&  getcustom('restaurant_fenhong_product_set')}
  layui.form.on('radio(fenhongset)', function(data){
	  if(data.value == '1'){
		  $('#fenhongset').show();
	  }else{
		  $('#fenhongset').hide();
	  }
  })
{/if}
{if getcustom('restaurant_product_stock_daily')}
layui.laydate.render({
	elem: '#stock_daily_time',
	trigger: 'click',
	type:'time',
	format: 'HH:mm'
});
{/if}
</script>
	{include file="public/copyright"/}
</body>
</html>